<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户查看</title>
</head>
<body>
<div class="cl pd-20" style=" background-color:#5bacb6">
	<img class="avatar size-XL l" src="static/h-ui/images/ucnter/avatar-default.jpg">
	<dl style="margin-left:80px; color:#fff">
		<dt>
			<span class="f-18" id="customerName"></span>
			<span class="pl-10 f-12" id="userBalance"></span>
		</dt>
		<dd class="pt-10 f-12" style="margin-left:0" id="remark"></dd>
	</dl>
</div>
<div class="pd-20">
	<table class="table">
		<tbody>
			<tr>
				<th class="text-r" width="80">性别：</th>
				<td id="gender"></td>
			</tr>
			<tr>
				<th class="text-r">手机：</th>
				<td id="userMobile"></td>
			</tr>
			<tr>
				<th class="text-r">邮箱：</th>
				<td id="email"></td>
			</tr>
			<tr>
				<th class="text-r">地址：</th>
				<td id="cityName"></td>
			</tr>
			<tr>
				<th class="text-r">注册时间：</th>
				<td id="registerTime"></td>
			</tr>
			<tr>
				<th class="text-r">积分：</th>
				<td id="userPoint"></td>
			</tr>
		</tbody>
	</table>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> 
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
	$(function() {
		var customerInfId = getParamForUrl("customerInfId");
		if (customerInfId != "" && customerInfId != undefined && customerInfId != "undefined") {
			initUserInfo(customerInfId,null);
		}
		var customerId = getParamForUrl("customerId");
		if (customerId != "" && customerId != undefined && customerId != "undefined") {
			initUserInfo(null,customerId);
		}
	});

	//初始化表单数据
	function initUserInfo(customerInfId, customerId){
		var service = {};
		service.customerInfId = customerInfId;
		service.customerId = customerId;
		$.ajax({
			type: 'post',
			url: '../memberApi/queryMembersById.do',
			async:true,
			data:{
				params:JSON.stringify(service)
			},
			success:function(data){
				if(data.respData.respCode == 10000){
					var customerInfo = data.respData.result;
					$("#customerName").text(customerInfo.customerName);
					$("#userMobile").text(customerInfo.userMobile);
					$("#email").text(customerInfo.email);
					$("#gender").text(customerInfo.gender==1?'男':'女');
					$("#cityName").text(customerInfo.cityName);
					$("#registerTime").text(customerInfo.registerTime);
					$("#userBalance").text("余额：" + customerInfo.userBalance);
					$("#userPoint").text(customerInfo.userPoint);
					$("#remark").text(customerInfo.remark);
				}else{
					layer.msg('未查询到数据!',{icon: 6,time:2000});
				}
			},
			error:function(data){
				layer.msg('服务异常，请联系管理员处理!',{icon: 6,time:3000});
			}
		});
	}

	/***
	 * 获取在前端路径GET传过来的参数
	 *
	 * @param param
	 * @returns {*}
	 */
	function getParamForUrl(param) {
		var url = location.href;
		var i=url.indexOf('?');
		if(i==-1)return;
		var querystr=url.substr(i+1);
		var arr1=querystr.split('&');
		var arr2 = new Object();
		for  (i in arr1){
			var ta=arr1[i].split('=');
			arr2[ta[0]]=ta[1];
		}
		return arr2[param];
	}
</script>
</body>
</html>